<?php
defined( '_JEXEC' ) or die( 'Restricted index access' );


function getColor($name, $params)
{ 
  $result = $params->get($name);
  $temp = JREQUEST::getVar($name);
  if (!empty($temp))
  {
    $result = $temp;
  }
  return $result;
}


$wbDescPageBackground           = getColor('wbDescPageBackground', $this->params);
$wbColorPageBackground          = getColor('wbColorPageBackground', $this->params);
$wbDescContentBackground        = getColor('wbDescContentBackground', $this->params);
$wbColorContentBackground       = getColor('wbColorContentBackground', $this->params);
$wbDescContentText              = getColor('wbDescContentText', $this->params);
$wbColorContentText             = getColor('wbColorContentText', $this->params);
$wbDescDefaultLink              = getColor('wbDescDefaultLink', $this->params);
$wbColorDefaultLink             = getColor('wbColorDefaultLink', $this->params);
$wbDescModuleHeaderBackground   = getColor('wbDescModuleHeaderBackground', $this->params);
$wbColorModuleHeaderBackground  = getColor('wbColorModuleHeaderBackground', $this->params);
$wbDescMenuHeaderBackground     = getColor('wbDescMenuHeaderBackground', $this->params);
$wbColorMenuHeaderBackground    = getColor('wbColorMenuHeaderBackground', $this->params);
$wbDescTextHeaderBackground     = getColor('wbDescTextHeaderBackground', $this->params);
$wbColorTextHeaderBackground    = getColor('wbColorTextHeaderBackground', $this->params);
$wbDescMenuBackground           = getColor('wbDescMenuBackground', $this->params);
$wbColorMenuBackground          = getColor('wbColorMenuBackground', $this->params);


?>

<style type="text/css">
#right
{
  width:<?php echo $rightColumnWidth ?>%;
}
#left
{
  width:<?php echo $leftColumnWidth ?>%;
}
#content
{
  width:<?php echo $contentWidth ?>%;
}
#wrap
{
  background-color: <?php echo $wbColorContentBackground; ?>;
  color: <?php echo $wbColorContentText ?>;
}
div.controlpanel
{
  background-color: <?php echo $wbColorContentBackground; ?>;
  color: <?php echo $wbColorContentText  ?>;
  border:1px solid #AAAAAA;
}
#controlhandle
{
  float:left;
  width:7em; 
  background-color:<?php echo $wbColorContentBackground; ?>;
}
#controlpanelx
{
  cursor:pointer; 
  width:7.2em; 
  margin:0 auto; 
  border-top:0;
}
body
{
  background-color: <?php echo $wbColorPageBackground; ?>;
  color:#808080;
}
#controlpanel
{
  position:absolute;
  right:10px;
  top:-51px;
}
a
{
  color:<?php echo $wbColorDefaultLink; ?>;
}
.moduletable h3
{
  background-color:<?php echo $wbColorModuleHeaderBackground; ?>; 
}
.moduletable_menu h3
{
  background-color:<?php echo $wbColorMenuHeaderBackground; ?>; 
}
.moduletable_text h3
{
  background-color:<?php echo $wbColorTextHeaderBackground; ?>; 
}
</style>

<?php

/*
.moduletable_wbMenu,
.moduletable_wbMenu a
{
  background-color:<?php echo $wbColorMenuBackground; ?>;
}
*/  

?>

<script type="text/javascript">

/*jslint white:false 
*/
function TWbColors()
{
  this.constants = 
  {
    wbDescPageBackground              : 'wbDescPageBackground'          ,
    wbColorPageBackground             : 'wbColorPageBackground'         ,
    wbDescContentBackground           : 'wbDescContentBackground'       ,
    wbColorContentBackground          : 'wbColorContentBackground'      ,     
    wbDescContentText                 : 'wbDescContentText'             ,            
    wbColorContentText                : 'wbColorContentText'            ,           
    wbDescDefaultLink                 : 'wbDescDefaultLink'             ,            
    wbColorDefaultLink                : 'wbColorDefaultLink'            ,           
    wbDescModuleHeaderBackground      : 'wbDescModuleHeaderBackground'  , 
    wbColorModuleHeaderBackground     : 'wbColorModuleHeaderBackground' ,
    wbDescMenuHeaderBackground        : 'wbDescMenuHeaderBackground'    ,   
    wbColorMenuHeaderBackground       : 'wbColorMenuHeaderBackground'   ,  
    wbDescTextHeaderBackground        : 'wbDescTextHeaderBackground'    ,   
    wbColorTextHeaderBackground       : 'wbColorTextHeaderBackground'   ,    
    wbDescMenuBackground              : 'wbDescMenuBackground'          ,
    wbColorMenuBackground             : 'wbColorMenuBackground'
  };
  this.values = 
  {
    wbDescPageBackground              : '<?php echo $wbDescPageBackground         ; ?>',
    wbColorPageBackground             : '<?php echo $wbColorPageBackground        ; ?>',
    wbDescContentBackground           : '<?php echo $wbDescContentBackground      ; ?>',
    wbColorContentBackground          : '<?php echo $wbColorContentBackground     ; ?>',     
    wbDescContentText                 : '<?php echo $wbDescContentText            ; ?>',  
    wbColorContentText                : '<?php echo $wbColorContentText           ; ?>',           
    wbDescDefaultLink                 : '<?php echo $wbDescDefaultLink            ; ?>',  
    wbColorDefaultLink                : '<?php echo $wbColorDefaultLink           ; ?>',           
    wbDescModuleHeaderBackground      : '<?php echo $wbDescModuleHeaderBackground ; ?>',
    wbColorModuleHeaderBackground     : '<?php echo $wbColorModuleHeaderBackground; ?>',
    wbDescMenuHeaderBackground        : '<?php echo $wbDescMenuHeaderBackground   ; ?>',
    wbColorMenuHeaderBackground       : '<?php echo $wbColorMenuHeaderBackground  ; ?>',  
    wbDescTextHeaderBackground        : '<?php echo $wbDescTextHeaderBackground   ; ?>',
    wbColorTextHeaderBackground       : '<?php echo $wbColorTextHeaderBackground  ; ?>',
    wbDescMenuBackground              : '<?php echo $wbDescMenuBackground         ; ?>',         
    wbColorMenuBackground             : '<?php echo $wbColorMenuBackground        ; ?>'
  };
  
  this.setValue = function (value)
  {
    this.values[this.selectedColor] = value;
  }
  
  this.getValue = function ()
  {
    return this.values[this.selectedColor];
  }
  
  this.selectedColor = this.constants.wbColorPageBackground;
}


</script>
